libxl: improve logging on failure to start device model.
authorIan Campbell <ian.campbell@citrix.com>
Tue, 24 May 2011 15:15:53 +0000 (16:15 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 24 May 2011 15:15:53 +0000 (16:15 +0100)
Distinguish between device model dying during startup (libxl__spawn_check
returns failure) and timing out while waiting for the xenstore node to show up.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl_device.c

index a3826bdc1cac0d6591cc9bc6e824bae2246f356e..cc3ae25d1aa933d02470d4ebc37beabd79f77978 100644 (file)
@@ -445,6 +445,8 @@ int libxl__wait_for_device_model(libxl__gc *gc,
         if ( starting ) {
             rc = libxl__spawn_check(gc, starting->for_spawn);
             if ( rc ) {
+                LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
+                           "Device Model died during startup");
                 rc = -1;
                 goto err_died;
             }
@@ -487,10 +489,10 @@ again:
             }
         }
     }
+    LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Device Model not ready");
 err_died:
     xs_unwatch(xsh, path, path);
     xs_daemon_close(xsh);
-    LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Device Model not ready");
 err:
     return -1;
 }